import { request } from "./request"



// 获取验证码
export const parentAideSendVCode = (data: {appType: 1 | 2, phone: string | number}) => {
	return request({
		url: 'v1/rewardMember/managementPhoneXCXSendVCode',
		method: 'POST',
		data
	})
}

// 家长端验证码登录
type loginProps = {
	appDownChannel: "jzsszs_xcx",
	mobileBrand : 'weixin'
	username: string,
	appType: '1' | '2' // APP类别: 1.3985 2.家长守护助手
	code: string | number
	// identification: boolean // 家长端or分销端区分
	[key: string]:any
}
export const login = (data: loginProps) => {
	return request({
		url: 'v1/rewardMember/idCodeLogin',
		method: 'POST',
		data
	})
}


// 获取微信小程序openId
export const getOpenId = async ({code}: {code: string }) => {
	return request({
		url: `v1/miniapp/openId`,
		method: 'POST',
		data: {
			code
		}
	})
}


// 管手机通过获取用户手机号登录
export const loginByUserPhone  = async ({loginCode, phoneCode, sharecode}) => {
	return request({
		url:'v1/rewardMember/login',
		method: 'POST',
		data: {
			"appDownChannel": "jzsszs_xcx",
			"mobileBrand": "weixin",
			"memberType": "1",
			"pkg": "com.jzzs.parent",
			"versionCode": "3.1.1",
			 loginCode,
			 phoneCode, 
			 sharecode
		}
	})
}


